home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / mildred / lha / ilbmviewer.lha / Prefs.ascii < prev    next >
Text File  |  1998-11-25  |  5KB  |  143 lines

  1.  
  2. ;Preferences
  3.  
  4. PrefDisplayID.l=$0      ; Default (unspecified, as it may possibly retarget if they have gfx card)
  5. ;PrefDisplayID.l=$40120000 ; Cybervision Lores 320x240 ?Hz
  6. ;PrefDisplayID.l=$21000 ; AGA Lores PAL 320x256 non-laced single-scan 50Hz
  7. ;PrefDisplayID.l=$A1000 ; AGA Lores DoublePAL 384x275 non-laced double-scan 48Hz
  8. ;PrefDisplayID.l=$89000 ; AGA Lores Super72 384x290 non-laced single-scan 71Hz
  9. ;PrefDisplayID.l=$11000 ; AGA Lores NTSC 320x200 non-laced single-scan 60Hz
  10. ;PrefDisplayID.l=$39000 ; AGA Lores Multiscan 320x240 double-scan 58Hz
  11. ;PrefDisplayID.l=$59000 ; AGA Lores HighGFX 512x250 non-laced single-scan 54Hz
  12. ;PrefDisplayID.l=$69000 ; AGA Lores Euro72 320x200 non-laced double-scan 69Hz
  13. ;PrefDisplayID.l=$91000 ; AGA Lores DoubleNTSC 384x227 non-laced double-scan 58Hz
  14. ;PrefDisplayID.l=$29004 ; AGA PAL 640x400 Hires laced single-scan 50Hz
  15. ;PrefDisplayID.l=$19004 ; AGA NTSC 640x400 Hires laced single-scan 60Hz
  16. ;PrefDisplayID.l=$39024 ; AGA Multiscan 640x400 Hires non-laced single-scan 58Hz
  17. ;PrefDisplayID.l=$69024 ; AGA Euro72 640x400 Hires non-laced single-scan 69Hz
  18. ;PrefDisplayID.l=$A9004 ; AGA DoublePAL 640x400 Hires non-laced double-scan 48Hz
  19. ;PrefDisplayID.l=$99004 ; AGA DoubleNTSC 640x400 Hires non-laced double-scan 58Hz
  20. PrefDisplayWidth.w=320
  21. PrefDisplayHeight.w=240
  22. PrefDisplayBuffering.b=2 ; 1..3
  23. PrefDisplayLacing.b=0 ; 0 or 1 (1=row lacing)
  24. PrefDisplayColumning.b=0 ; 0 or 1 (1=colum lacing)
  25. ;If Joyb(0)=0 AND Joyb(1)=0 Then Goto PrefsSkip
  26.  
  27. #DTAG_DISP=$80000000
  28. #DTAG_DIMS=$80001000
  29. #DTAG_MNTR=$80002000
  30. #DTAG_NAME=$80003000
  31.  
  32. NEWTYPE.SMode
  33.   DID.l
  34.   DWidth.l
  35.   DHeight.l
  36.   DDepth.w
  37.   DType.w
  38. End NEWTYPE
  39.  
  40. DEFTYPE.Hook myhook ; The hook for ASL tag as &myhook
  41. myhook\h_Entry=?hook
  42. MOVE.l a5,globalbase
  43. funcret.l=0
  44.  
  45. Dim SMRtags.TagItem(17)
  46. SMRtags(0)\ti_Tag=#ASLSM_InitialLeftEdge,160
  47. SMRtags(1)\ti_Tag=#ASLSM_InitialTopEdge,0
  48. SMRtags(2)\ti_Tag=#ASLSM_InitialWidth,300
  49. SMRtags(3)\ti_Tag=#ASLSM_InitialHeight,600
  50. SMRtags(4)\ti_Tag=#ASLSM_InitialDisplayID,$21000
  51. SMRtags(5)\ti_Tag=#ASLSM_InitialDisplayDepth,8
  52. SMRtags(6)\ti_Tag=#ASLSM_InitialDisplayWidth,PrefDisplayWidth
  53. SMRtags(7)\ti_Tag=#ASLSM_InitialDisplayHeight,PrefDisplayHeight
  54. SMRtags(8)\ti_Tag=#ASLSM_InitialOverscanType,1
  55. SMRtags(9)\ti_Tag=#ASLSM_InitialInfoOpened,1
  56. SMRtags(10)\ti_Tag=#ASLSM_InitialInfoLeftEdge,350
  57. SMRtags(11)\ti_Tag=#ASLSM_InitialInfoTopEdge,50
  58. SMRtags(12)\ti_Tag=#ASLSM_DoDepth,0
  59. SMRtags(13)\ti_Tag=#ASLSM_DoOverscanType,1
  60. SMRtags(14)\ti_Tag=#ASLSM_DoWidth,1
  61. SMRtags(15)\ti_Tag=#ASLSM_DoHeight,1
  62. SMRtags(16)\ti_Tag=#ASLSM_FilterFunc,&myhook
  63. SMRtags(17)\ti_Tag=#TAG_DONE,0
  64.  
  65. *sreq.SMode=0
  66. *sreq=AllocAslRequest_(2,&SMRtags(0)\ti_Tag)
  67. ok.b=AslRequest_(*sreq,&SMRtags(0)\ti_Tag)
  68.  
  69. If ok<>0
  70.   PrefDisplayID.l=*sreq\DID
  71.   PrefDisplayWidth.w=*sreq\DWidth
  72.   PrefDisplayHeight.w=*sreq\DHeight
  73. EndIf
  74. If (*sreq) Then FreeAslRequest_(*sreq)
  75.  
  76. Goto PrefsSkip
  77.  
  78. ;*************************************************************************
  79. ; This is the statement that the hook will call.  Put the label before
  80. ; the statement you want to jump to.
  81. Runerrsoff
  82. .hook_jump:
  83. Statement hook{*dahook.Hook, modeID.l, *smr.ScreenModeRequester}
  84.   ; We're inside the hook, and supposedly we should be able to do whatever
  85.   ; we want.
  86.   ; Filter modeID's here
  87.   SHARED funcret.l
  88.   DEFTYPE.DisplayInfo DisInfoBuf
  89.   DEFTYPE.DimensionInfo DimInfoBuf
  90.   DEFTYPE.MonitorInfo MonInfoBuf
  91.   DEFTYPE.NameInfo NamInfoBuf
  92.   ;Refer to Includes/Graphics/DisplayInfo.h or view newtypes
  93.   IDhandle.l=FindDisplayInfo_(modeID)
  94.   GetDisplayInfoData_ IDhandle,&DisInfoBuf,SizeOf.DisplayInfo,#DTAG_DISP,0
  95.   GetDisplayInfoData_ IDhandle,&DimInfoBuf,SizeOf.DimensionInfo,#DTAG_DIMS,0
  96.   GetDisplayInfoData_ IDhandle,&MonInfoBuf,SizeOf.MonitorInfo,#DTAG_MNTR,0
  97.   GetDisplayInfoData_ IDhandle,&NamInfoBuf,SizeOf.NameInfo,#DTAG_NAME,0
  98.   ;Do tests. True=Mode is valid, False=mode is invalid.
  99.   If DimInfoBuf\MaxDepth<>8
  100.     ;No true-colour modes, only 8-bit
  101.     funcret=False
  102.   Else
  103.     funcret=True
  104.   EndIf
  105. End Statement
  106. ;*************************************************************************
  107.  
  108.  
  109. ;*************************************************************************
  110. ; Hook
  111. Macro goto_hook
  112.   JSR `1+6
  113. End Macro
  114.  
  115. globalbase: Dc.l 0
  116.  
  117. hook: ;This hook is called by the filter hook callback from screenmode requester, per item
  118. ; Store registers
  119. MOVEM.l   d1-d7/a0-a6,-(a7) ; Not d0!
  120.  
  121. ; Put parameters into dregs ready for a statement
  122. MOVE.l    a0,d0
  123. MOVE.l    a1,d1
  124. MOVE.l    a2,d2
  125.  
  126. ; Get global variable base
  127. MOVE.l    globalbase,a5
  128.  
  129. ; Goto hook statement
  130. !goto_hook{hook_jump}
  131.  
  132. GetReg d0,funcret ; return accept/discard
  133.  
  134. ; Restore registers
  135. MOVEM.l   (a7)+,d1-d7/a0-a6 ; Not d0!
  136.  
  137. RTS
  138.  
  139. Runerrson
  140. PrefsSkip
  141. PrefDisplayHeight AND $FFFE ; Not odd, otherwise interlaced display wont do all lines
  142.  
  143.